package com.nkzy.service.impl;

import com.nkzy.domain.User;
import com.nkzy.mapper.UserMapper;
import com.nkzy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    //依赖注入
    @Autowired
    private UserMapper userMapper;
    public List<User> findAll() {
        return userMapper.findAll();
    }

    public User findById(Integer id) {
        return userMapper.findById(id);
    }

    public void updateUser(User user) {
        userMapper.updateUser(user);
    }
    public void deleteUser(Integer id){
        userMapper.deleteUser(id);
    }
    public void insertUser(){
        userMapper.InsertUser();
    }
}
